package com.chance.cc.crawler.development.command.publish.douban;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.douban.searchKw.DoubanSearchKwRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.douban.searchKw.DoubanSearchKwSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.douban.searchKw.DoubanSearchKwTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.domain.douban.DoubanScheduleTrigger;

/**
 * @Author Zhao.Hhuan
 * @Date Create in 2021/3/31 17:20
 * @Description
 *      豆瓣
 **/
public class DoubanPublishCrawlerJob {
    public static void main(String[] args) {

//        publishSearchKwSimpleJob();

        publishSearchKwRealtimeJob();
        publishSearchKwTraceJob();
//        DoubanCrawlerScript.publishCrawlerNodeScript();
    }

    public static void publishSearchKwSimpleJob(){
        CrawlerJob crawlerJob = DoubanSearchKwSimpleCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        DoubanScheduleTrigger.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    public static void publishSearchKwRealtimeJob(){
        CrawlerJob crawlerJob = DoubanSearchKwRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        DoubanScheduleTrigger.realtimeCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }


    public static void publishSearchKwTraceJob(){
        CrawlerJob crawlerJob = DoubanSearchKwTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        DoubanScheduleTrigger.traceCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }
}
